package jerry.cn.common.Tools;

public class ASCII_Tools {

    public static int[] string2ASCII(String s) {// 字符串转换为ASCII码   
        if (s == null || "".equals(s)) {
            return null;
        }

        char[] chars = s.toCharArray();
        int[] asciiArray = new int[chars.length];

        for (int i = 0; i < chars.length; i++) {
            asciiArray[i] = char2ASCII(chars[i]);
        }
        return asciiArray;
    }

    public static int char2ASCII(char c) {
        return (int) c;
    }
}
